home *** CD-ROM | disk | FTP | other *** search
/ Windows Expert / Windows Expert.iso / program / blx13.zip / MDIEDIT.ZIP / MDIEDIT.CPP < prev    next >
C/C++ Source or Header  |  1991-10-14  |  1KB  |  54 lines

  1. // mdiedit.cpp
  2.  
  3. #include <owl.h>
  4. #include <bwcc.h>
  5. #include "menus.h"
  6. #include "editfram.h"
  7. #include <stdlib.h>
  8.  
  9. class TMDIEditApp : public TApplication {
  10. public:
  11.     TMDIEditApp(LPSTR name, HANDLE MyHInstance,
  12.         HANDLE MyHPrevInstance,    LPSTR MyCmdLine, int MyNCmdShow)
  13.         : TApplication(name, MyHInstance, MyHPrevInstance,
  14.             MyCmdLine, MyNCmdShow) {}
  15. protected:
  16.     virtual void InitMainWindow(void);
  17.     virtual void InitApplication(void);
  18.     virtual void InitInstance(void);
  19.     };
  20.  
  21. void TMDIEditApp::InitMainWindow(void) {
  22.     MainWindow = new TMDIEditFrame("MDI Editor", NULL);
  23.     }
  24.  
  25. void TMDIEditApp::InitApplication(void) {
  26.     if(hPrevInstance) {
  27.         MessageBox(0, "MDIEdit is already running.",
  28.             "MDI Edit",
  29.             MB_ICONSTOP | MB_OK);
  30.         exit(1);
  31.         }
  32.     BWCCGetVersion();    // Make sure BWCC gets initialized.
  33.     TApplication::InitApplication();
  34.     }
  35.  
  36. void TMDIEditApp::InitInstance(void) {
  37.     TApplication::InitInstance();
  38.     if(Status == 0) {
  39.         HAccTable = LoadAccelerators(hInstance,
  40.             "FileCommands");
  41.         if(HAccTable == 0)
  42.             Status = EM_INVALIDWINDOW;
  43.         }
  44.     }
  45.  
  46. int PASCAL WinMain(HANDLE hInstance, HANDLE hPrevInstance,
  47.            LPSTR lpCmd, int nCmdShow)
  48. {
  49.     TMDIEditApp MDIEditApp("MDIEditApp", hInstance, hPrevInstance,
  50.         lpCmd, nCmdShow);
  51.     MDIEditApp.Run();
  52.     return (MDIEditApp.Status);
  53.     }
  54.